package cn.portx.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.bstek.bdf3.dorado.jpa.annotation.Generator;
import com.bstek.dorado.annotation.PropertyDef;

import cn.portx.policy.CreateUserPolicy;
import cn.portx.policy.CreatedDatePolicy;
import cn.portx.policy.IdGeneratorPolicy;

/**
 * Model class of 业务备忘录.
 * 
 * @author generated by ERMaster
 * @version $Id$
 */
@Entity
@Table(name = "T_MEMORANDUM")
public class Memorandum extends BaseEntity {

	/** serialVersionUID. */
	private static final long serialVersionUID = 1L;

	/** 订单ID. */
	@Column(name = "ORDER_ID_", length = 60)
	@PropertyDef(label = "订单ID", description = "订单ID:订单ID")
	private String orderId;

	@Transient
	private Order order;

	/** 序号. */
	@Column(name = "SERIAL_NUM_")
	@PropertyDef(label = "序号", description = "序号:序号")
	private Integer serialNum;

	/** 内容. */
	@Column(name = "CONTENT_", length = 300)
	@PropertyDef(label = "内容", description = "内容:内容")
	private String content;

	/**
	 * Constructor.
	 */
	public Memorandum() {
	}

	/**
	 * Set the 订单ID.
	 * 
	 * @param orderId
	 *            订单ID
	 */
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	/**
	 * Get the 订单ID.
	 * 
	 * @return 订单ID
	 */
	public String getOrderId() {
		return this.orderId;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	/**
	 * Set the 序号.
	 * 
	 * @param serialNum
	 *            序号
	 */
	public void setSerialNum(Integer serialNum) {
		this.serialNum = serialNum;
	}

	/**
	 * Get the 序号.
	 * 
	 * @return 序号
	 */
	public Integer getSerialNum() {
		return this.serialNum;
	}

	/**
	 * Set the 内容.
	 * 
	 * @param content
	 *            内容
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * Get the 内容.
	 * 
	 * @return 内容
	 */
	public String getContent() {
		return this.content;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((this.getId() == null) ? 0 : this.getId().hashCode());
		return result;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		Memorandum other = (Memorandum) obj;
		if (this.getId() == null) {
			if (other.getId() != null) {
				return false;
			}
		} else if (!this.getId().equals(other.getId())) {
			return false;
		}
		return true;
	}

}
